//
//  ButtonAndLabelView.m
//  DolphinMusic
//
//  Created by dllo on 15/3/23.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ButtonAndLabelView.h"

@implementation ButtonAndLabelView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc
{
    [_imageView release];
    [_button release];
    [_titleLabel release];
    [_autorLabel release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        CGFloat width = frame.size.width;
        CGFloat height = frame.size.height;
        
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width, width)];
        [self addSubview:self.imageView];
        [_imageView release];
        
        
        self.button = [UIButton buttonWithType:UIButtonTypeSystem];
        self.button.frame = CGRectMake(0, 0, width, width);
        [self addSubview:self.button];
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, width + 3, width, 15)];
        [self addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.autorLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, width + 18 + 3, width, height - width - 21)];
        [self addSubview:self.autorLabel];
        [_autorLabel release];
        
        
    }
    return self;
}





@end
